package com.example.demo;

import com.example.demo.domain.student;
import com.example.demo.mapper.UserMapper;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author
 * @create 86153-2021
 */
@RunWith(SpringRunner.class)
@Controller
public class Controllerhe {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping({"/first"})
    public String toFirst(){
        List<student> list=userMapper.findAll();
        return "/first";
    }

    @RequestMapping("/he")
    @ResponseBody
    public String first(){
        return "hekk";
    }



    @RequestMapping({"/index"})
    public String index(){
        return "index";
    }



    @RequestMapping({"/1"})
    public String level31(){
        return "1.html";
    }

    @RequestMapping({"/2"})
    public String level32(){
        return "2.html";
    }

    @RequestMapping({"/3"})
    public String level33(){
        return "3.html";
    }

//    @RequestMapping({"/level1/{id}"})
//    public String level1(@PathVariable("id") int id){
//        return "views/level1"+id;
//    }
//
//    @RequestMapping({"/level2/{id}"})
//    public String level2(@PathVariable("id") int id){
//        return "views/level2"+id;
//    }
//
//    @RequestMapping({"/level2/{id}"})
//    public String level3(@PathVariable("id") int id){
//        return "views/level2"+id;
//    }
//


}
